From ea8b41e57dec09146167c33ae7ac60a304e11127 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Thu, 25 Nov 2010 19:47:24 +0000 Subject: [PATCH] consistent incr() return value in case of error. follow up 74579 --- includes/BagOStuff.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/BagOStuff.php b/includes/BagOStuff.php index 04900f4981..5ef9472f6f 100644 --- a/includes/BagOStuff.php +++ b/includes/BagOStuff.php @@ -130,9 +130,12 @@ abstract class BagOStuff { } } + /** + * @return null if lock is not possible. New value incremented by 1 + */ public function incr( $key, $value = 1 ) { if ( !$this->lock( $key ) ) { - return false; + return null; } $value = intval( $value ); -- 2.20.1